package book;

// 出租图书类(继承自图书类)
public class RentBook extends Book {
    String bookNo;  // 图书入库编号
    boolean state;  // 图书是否可借状态

    public RentBook(String isbn, String name, String author, String publisher,
                    double price, String no) {
        super(isbn, name, author, publisher, price);
        bookNo = no;
        state = true;  // 新入库图书状态为可借
    }

    public void setBookNo(String no) {
        bookNo = no;
    }

    public String getBookNo() {
        return bookNo;
    }

    public void setState(boolean state) {
        this.state = state;
    }

    public boolean getState() {
        return state;
    }

    public String toString() {
        return super.toString() + " 入库号:" + getBookNo() + " 是否可借:" + getState();
    }
}
